<style>
    .div1 {
        border: 2px solid red;
        overflow-y: auto;
        height: 500px;
    }
    .div2 {
        height: 1000px;
        width: 100px;
        background-color: salmon;
    }
</style>
<div id="div1" class="div1">
    <div class="div2"></div>
</div>